﻿<BaseClass:ListControlBase x:Class="Rio.Framework.Pages.Controls.ListDocumentControl"
                           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                           xmlns:BaseClass="clr-namespace:Rio.Framework.Pages.Controls.BaseClass"
                           xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                           xmlns:Converter="clr-namespace:Rio.Framework.Pages.AppCode.Helpers.Converter"
                           mc:Ignorable="d"
                           d:DesignHeight="300"
                           d:DesignWidth="400">

    <BaseClass:ListControlBase.Resources>
        <Style x:Key="GridViewRowStyle"
               TargetType="telerik:GridViewRow">
            <Setter Property="IsTabStop"
                    Value="False" />
            <Setter Property="Background"
                    Value="{StaticResource GridViewRowNormalBackground}" />
            <Setter Property="BorderBrush"
                    Value="{StaticResource GridLinesFill}" />
            <Setter Property="Foreground"
                    Value="{StaticResource GridViewForeground}" />
        </Style>
        <Style x:Key="GridViewAlternateRowStyle"
               TargetType="telerik:GridViewRow">
            <Setter Property="Background"
                    Value="#FFEDECD8" />
        </Style>

        <Converter:ExtensionToImageConverter x:Key="ExtensionToImageConverter" />
    </BaseClass:ListControlBase.Resources>

    <Grid HorizontalAlignment="Stretch"
          VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <telerik:RadToolBar Grid.Column="0"
                            Grid.ColumnSpan="2"
                            Grid.Row="0"
                            x:Name="RadMenu"
                            VerticalAlignment="Top"
                            Background="#00C8C5C5"
                            Visibility="Visible"
                            IsOverflowOpen="False"
                            BorderThickness="1">
            <telerik:RadMenuItem Name="buttonDisplay"
                                 IsEnabled="False"
                                 Header="Afficher"
                                 Click="buttonDisplay_Click">
                <telerik:RadMenuItem.Icon>
                    <Image Source="../Assets/Images/Display.png"
                           Width="20"
                           Margin="0,0,0,0" />
                </telerik:RadMenuItem.Icon>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Name="buttonDelete"
                                 IsEnabled="False"
                                 Header="Supprimer"
                                 Click="buttonDelete_Click">
                <telerik:RadMenuItem.Icon>
                    <Image Source="../Assets/Images/Trash.png"
                           Width="20"
                           Margin="8,0,0,0" />
                </telerik:RadMenuItem.Icon>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Name="buttonExport"
                                 IsEnabled="False"
                                 Header="Exporter"
                                 Click="buttonExport_Click">
                <telerik:RadMenuItem.Icon>
                    <Image Source="../Assets/Images/Excel16.png"
                           Width="20"
                           Margin="8,0,0,0" />
                </telerik:RadMenuItem.Icon>
            </telerik:RadMenuItem>
        </telerik:RadToolBar>

        <TextBlock Grid.Row="0"
                   Name="LabelNbrOfDocumentResults"
                   HorizontalAlignment="Right"
                   Margin="5,5,15,-8"
                   VerticalAlignment="Bottom"
                   Visibility="Collapsed"
                   Height="30" />

        <telerik:RadGridView CanUserDeleteRows="True"
                             x:Name="GridViewDoc"
                             Grid.Row="1"
                             SelectionMode="Extended"
                             RowHeight="32"
                             AutoGenerateColumns="False"
                             IsFilteringAllowed="true"
                             ShowGroupPanel="True"
                             AlternationCount="2"
                             AlternateRowStyle="{StaticResource GridViewAlternateRowStyle}"
                             Deleting="GridViewDoc_Deleting"
                             DataLoaded="GridViewDoc_DataLoaded"
                             SelectionChanged="GridViewDoc_SelectionChanged"
                             GridLinesVisibility="Horizontal">

            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu ItemClick="RadContextMenu_ItemClick"
                                        Opened="RadContextMenu_Opened">
                    <telerik:RadMenuItem Name="DeleteItemContextMenu">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/Trash16.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem IsSeparator="True" />
                    <telerik:RadMenuItem Name="ExportExcelContextMenu">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/Excel16.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem IsSeparator="True" />
                    <telerik:RadMenuItem Name="OpenDocumentContextMenu">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/DisplayFolder.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Name="SaveDocumentContextMenu"
                                         Header="">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/Viewer/Save16.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem IsSeparator="True" />
                    <telerik:RadMenuItem Name="PrintMenuContextMenu">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../../Assets/Images/Viewer/Printer16.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Name="SendMailContextMenu"
                                         Header="">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="../Assets/Images/SendMail.png" />
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>
        </telerik:RadGridView>

        <telerik:RadDataPager x:Name="DataPagerDoc"
                              Grid.Row="2"
                              DisplayMode="FirstLastPreviousNextNumeric"
                              IsTotalItemCountFixed="False"
                              PageSize="100"
                              NumericButtonCount="10" />
    </Grid>
</BaseClass:ListControlBase>